{% extends "index.html" %}
{% block main %}
<div class="book3">

{% if error %}
	{{ error }}
{% else %}

	{% ifequal url_linktext "Logout" %}
		<form id="addAdventure" action="/createStory" method="post" enctype="multipart/form-data">
		<table class="table1">
		<tr><th colspan="2"><h1>{{ title }}</h1></th></tr>
		<tr><th>Title:</th><td><input tabindex="1" type="text" name="title" value="{{ adventure.title|escape }}" size="30" maxlength="100"></td></tr>
		<tr><th>Author:</th><td><input tabindex="2" type="text" name="author" value="{{ adventure.author|escape }}" size="30" maxlength="100"></td></tr>
		<tr><th>Description:</th><td><textarea tabindex="3" name="desc" rows="3" cols="50">{{ adventure.desc|escape }}</textarea></td></tr>
		{% if adventure.coverImage %}
			<tr><th>Cover Image:</th><td><img src="/images/{{ adventure.coverImage }}.png"></td></tr>
		{% endif %}
		<tr><th>New Cover Image (320x150):</th><td><input tabindex="2" type="file" name="coverImage"></td></tr>
		<tr><td colspan="2"><center><input id="submitButton" tabindex="4" type="submit" value="{{ buttonText }}" onclick="this.form.submit();this.disabled=true"></center></td></tr>
		</table>
		<input type="hidden" name="myAdventureKey" value="{{ adventure.key }}">
		</form>
	{% else %}
	<a href="{{ url }}">{{ url_linktext }}</a>
	{% endifequal %}

{% endif %}
</div>
{% endblock %}

{% block index %}
{% endblock %}


